import java.util.HashMap;
import java.util.List;
import java.util.Map;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;


public class A {
private List<B> list;
public List<B> getList() {
return list;
}
public void setList(List<B> list) {
this.list = list;
}
public static void main(String[] args) {
	//int[] a=new int[]{1,2};
JSONObject json = JSONObject.fromObject("{list:[{name:'Tom',age:999}]}");
//JSONArray array = json.getJSONArray("list");
//B j=null;
Map classMap = new HashMap<String, Class>();
java.lang.Class<B> cl=B.class;
classMap.put("list", cl);
A j = (A) JSONObject.toBean(json, A.class,classMap);
//for(int i=0;i<array.size();++){
//	obj= array.getJSONObject(i);
//	System.out.println(obj.toString());
//    j = (B) JSONObject.toBean(obj, B.class);
//    
//}    
System.out.println(j.getList().get(0).getName());
System.out.println();
String[] a=new String[6];

a[0]="we";a[1]="are";a[2]="student";a[3]="i";

int sum=0;
for(String k:a){

System.out.print(k+" ");

}

for(int i=0;i<a.length;i++){

if(a[i]!=null&&a[i].length()>0){

sum++;

}

}

System.out.println(sum);
}
}
